package com.junyidao.game.controller;

import com.junyidao.game.core.LoginInfo;
import com.junyidao.game.core.annotation.Action;
import com.junyidao.game.pojo.SysUser;
import com.junyidao.game.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.Map;

/**
 * 个人中心  ：下级帐号管理
 * Created by zzh on 2016/8/28.
 */
@Controller
@RequestMapping("/subUser")
public class SubUserController extends BaseController {

    @Autowired
    private UserService userService;

    @RequestMapping
    @Action(desc = "进入下级用户页面")
    public ModelAndView list() {
        ModelAndView result = new ModelAndView("system/sub_user_list");
        return result;
    }

    @ResponseBody
    @RequestMapping(value = "/list")
    @Action(desc = "下级用户列表", sysPriv = false)
    public Map<String, Object> listData(SysUser SysUser) {
        Map<String, Object> map = userService.getAll(SysUser);
        return resultSucess(map);
    }

}
